// 实习宝藏的接口url
let submitTaskUrl = 'ido/app/task/student/' //后面接任务id
let getTaskListUrl = 'ido/app/task/student/list'
let getTaskUrl = 'ido/app/task/' //后面接任务id
let receiveTaskUrl = 'ido/app/task/student/' //后面接任务id
let getTaskRecordUrl = 'ido/app/task/student/taskRecord/list'
let getStarnumUrl = 'ido/app/task/getStarSumNum'
function treasureApi(vm){
	let getTaskList = () => vm.$u.get(getTaskListUrl)
	let getTask = (taskId = -1) => vm.$u.get(getTaskUrl + taskId)
	let getTaskRecord = () => vm.$u.get(getTaskRecordUrl)
	// 学生领取任务，领取之后才能提交
	let receiveTask = (taskId = -1, params = {}) => vm.$u.post(receiveTaskUrl + taskId, params)
	// 学生提交实习宝藏任务
	let submitTask = (taskId = -1, params = {}) => vm.$u.put(submitTaskUrl + taskId, params)
	// 得到任务星星数
	let getStarnum = () => vm.$u.get(getStarnumUrl)
	return {getTask,getTaskList,getTaskRecord,receiveTask,submitTask,getStarnum}
}
export default treasureApi